package demo11;

import java.util.Arrays;
import java.util.Random;

public class test {
    public static void main(String[] args) {
        Day3 day3 = new Day3();
        day3.totalFruit(new int[]{0,1,2,2});
        day3.minOperations(new int[]{8828,9581,49,9818,9974,9869,9991,10000,10000,10000,9999,9993,9904,8819,1231,6309},134365);
    }
    public static void main12(String[] args) {
        Day3 day3 = new Day3();
        day3.longestOnes(new int[]{1,1,1,0,0,0,1,1,1,1,0},2);
    }
    public static void main11(String[] args) {
        Day3 day3 = new Day3();
        day3.threeSum(new int[]{-1,0,1,2,-1,-4,-2,-3,3,0,4});
    }
    public static void main10(String[] args) {
        Day3 day3 = new Day3();
        ListNode head = new ListNode(1);
        ListNode head1 = new ListNode(2);
        ListNode head2 = new ListNode(2);
        ListNode head3 = new ListNode(1);
        head.next = head1;
        head1.next = head2;
        head2.next = head3;
        day3.chkPalindrome(head);
    }

    public static void main9(String[] args) {
        Day3 day3 = new Day3();
        ListNode head = new ListNode(1);
        ListNode head1 = new ListNode(6);
        ListNode head2 = new ListNode(2);
        ListNode head3 = new ListNode(8);
        head.next = head1;
        head1.next = head2;
        head2.next = head3;
        day3.partition(head.next,3);
    }
    public static void main8(String[] args) {
        Day3 day3 = new Day3();
        System.out.println(day3.largestNumber(new int[]{432, 43243}));
    }
    public static void main7(String[] args) {
        Day3 day3 = new Day3();
        System.out.println(day3.halveArray(new int[]{5, 19, 8, 1}));
    }
    public static void main6(String[] args) {
        Day3 day3 = new Day3();
        day3.getSum(2,3);
        Random random = new Random();
        System.out.println(random.nextInt(10));
    }

    public static void main5(String[] args) {
        Day3 day3 = new Day3();
        day3.findMaxLength(new int[]{0,1,0,1});
    }
    public static void main4(String[] args) {
        Day2 day2 = new Day2();
//        System.out.println(day2.threeSum(new int[]{-1, 0, 1, 2, -1, -4}));
        System.out.println(day2.fourSum(new int[]{1000000000, 1000000000, 1000000000, 1000000000}, -294967296));
    }
    public static void main3(String[] args) {
        Day2 day2 = new Day2();
        System.out.println(day2.isHappy(19));
    }
    public static void main2(String[] args) {
        Day1 day1 = new Day1();
        int[] arr = new int[]{1,0,2,3,0,4,5,0};
        System.out.println(Arrays.toString(arr));
        day1.func2(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void main1(String[] args) {
        Day1 day1 = new Day1();
        int[] arr = new int[]{1,0,5,0,3};
        System.out.println(Arrays.toString(arr));
        day1.func(arr);
        System.out.println(Arrays.toString(arr));
    }
}
